package com.example.my_tool_3;

import android.content.SharedPreferences;

public class Main {
    SharedPreferences config;
    SharedPreferences.Editor editor;

    String tv_connect_text;
    int tv_connect_text_color;
    int tv_connect_text_Shadow_color;

    String tv_ping_text;
    int tv_ping_text_color;
    int tv_ping_text_Shadow_color;


    String et_ip_text;
    String et_port_text;

    int tv_data_match_text_Shadow_color;
    byte img_sign = 0;
    byte threshold_Y = 0;
    byte threshold_YF = 0;
    byte threshold_R = 0;
    byte threshold_RF = 0;

    Main(SharedPreferences Config, SharedPreferences.Editor Editor)
    {
        config = Config;
        editor = Editor;
        tv_connect_text = "未连接";
        tv_connect_text_color = R.color.black;
        tv_connect_text_Shadow_color = R.color.crimson;


        tv_ping_text = "500ms";
        tv_ping_text_color = R.color.black;
        tv_ping_text_Shadow_color = R.color.crimson;

        String str = config.getString("et_ip_text", "null");
        if (str.equals("null")){
            et_ip_text = "192.168.100.105";
            editor.putString("et_ip_text", et_ip_text);
            editor.apply();
        }
        else{
            et_ip_text = str;
        }
        str = config.getString("et_port_text", "null");
        if (str.equals("null")){
            et_port_text = "45678";
            editor.putString("et_port_text", et_port_text);
            editor.apply();
        }
        else{
            et_port_text = str;
        }

        tv_data_match_text_Shadow_color= R.color.crimson;




    }





}
